home *** CD-ROM | disk | FTP | other *** search
- Path: www.cybercity.dk!usenet
- From: ccc6004@vip.cybercity.dk (Hans Henrik Happe)
- Newsgroups: comp.sys.amiga.programmer
- Subject: Re: disable datacache to gain speed , was Demo/game to OS friendly part II
- Date: 31 Jan 1996 23:28:27 GMT
- Organization: CyberCity of Denmark
- Message-ID: <4346.6605T24T900@vip.cybercity.dk>
- References: <john.hendrikx.48xr@grafix.xs4all.nl> <DLxyF9.oDD@wiloyee.shnet.org>
- NNTP-Posting-Host: 194.16.56.116
- X-Newsreader: THOR 2.22 (Amiga;TCP/IP) *UNREGISTERED*
-
-
- > John Hendrikx (john.hendrikx@grafix.xs4all.nl) wrote:
-
- >: That's interesting, on my setup however the Movem loop is not the fastest
- >: way to copy (but that's not the issue). The most interesting result from
- >: my test however was that turning off DataCache on my 68030/22 had a
- >: dramatic increase in copying performance:
-
- >: Testresults - Mar 21 1995
-
- >: Using a Movem-loop 200990 bytes/frame (PAL machine, 12 registers used,
- >: unrolled 3 times)
- >: (9.58 MB/sec, AIBB tells me 9.5-9.8 MB/sec)
-
- >: Using a 48 times unrolled Move.l-loop 212353 bytes/frame
- >: (10.1 MB/sec)
-
- >: Now with datacache off (!):
-
- >: Using a 48 times unrolled Move.l-loop 242323 bytes/frame
- >: (11.6 MB/sec)
-
- >: The Movem loop wasn't the most optimized version possible, but I doubt it
- >: would have made much difference.
-
- >: (All tests done on a 68030/22 MHz, 60ns 32-bit FastRAM. Source and
- >: destination were not overlapping. During tests interrupts and all DMA was
- >: disabled)
-
- >: Can anybody explain what is happening with the DataCaching? According to
- >: my tests ChipRAM access also becomes faster with DataCache off.
-
-
- > i have a similar problem. on my a4000/40 i can increase the speed of all
- > routines with random memory access by disabling the datacache. with random
- > memory access i mean things like texture mapping, rotating zoomers, etc.
- > that work on big textures, on a big memory region, but in a way that makes
- > caching allomost impossible.
-
- > here the solution is simple. the 68040 will ALLWAYS try a burst access,
- > meaning to read 4 longwords. but in the situation of a texturemapper with
- > large texture, 3 of them get thrown away. the 68040 does not allow you to
- > switch of the burst mode, you only can switch of the entire cache. if there
- > is no burst mode possible (as in the 4000/40), the cpu will read all 4
- > longword without burst. the result is, that it has to do 4 longword accesses
- > every time i want to read a single byte.
-
- > all my demos (yes, i am a kewl c0d3r) contain a routine that is called for
- > this effects, that checks the cpu and sets 68030 to burst off and 68040 to
- > cache off (this is an advantage even for real burst systems). well, on 68060
- > my demos crash...
-
- It's ok to turn off the cache if your rutine gets faster (and it does with
- rot-zoom and other random accessing rotines). But if you do - do it with
- system calls and make the 68060 people and me happy :).
-
- I have done this since the day I found out my 68040 acted wirred (random
- frame rates >:( ) when the datacache was on. I thought it was the cache
- reloading when accessing randomly, so I turned off the datacache with a system
- call (Exec/CacheControl) and turned it on again when I was finish doing my
- job... nice and clean and it worked... also on the 68060.
-
- But now you (Chaos - is it the ex. Sanity coder?) tells me this about the
- burst mode... so I had to change my code so it only turned of the burst mode
- on a 68030 and not the hole datacache like you have to on the 68040.
-
- and here it is...
-
- TURN OFF BURST
-
- move.l 4.w, a6 ; ExecBase in a6
-
- moveq #0, d0
- move.l #CACRF_DBE,d1 ; try to turn off Databurst
- CALL CacheControl
-
- move.l d0, cachebits ; save old cache state
-
- moveq #0, d0
- move.l d0, d1 ; don't change anything
- CALL CacheControl ; return current state of caches
-
- and.l #CACRF_DBE,d0 ; is burst of
- beq.b .burstoff ; go on
-
- moveq #0, d0 ; else
- move.l #CACRF_EnableD,d1 ; turn off the datacache
- CALL CacheControl ; (the only way 68040 can turn of
- ; Databurst)
-
-